package com.ticket.api.service.Impl;

import com.ticket.api.service.TbMarketInfoService;
import com.ticket.api.service.TbMarketParkInfoService;
import com.ticket.api.service.TbUserInfoService;
import com.ticket.common.string.StringUtil;
import com.ticket.common.time.CommonFunction;
import com.ticket.db.dao.TblMarketParkInfoMapper;
import com.ticket.db.entity.TblMarketParkInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class TbMarketParkInfoServiceImpl  implements TbMarketParkInfoService {

    @Autowired
    TblMarketParkInfoMapper tblMarketParkInfoMapper;

    @Override
    public List<TblMarketParkInfo> findTblMarketParkInfoAll(String userId) {
        return tblMarketParkInfoMapper.findTblMarketParkInfoAll(userId);
    }

    @Override
    public List<TblMarketParkInfo> findTblMarketParkInfoByCondition(TblMarketParkInfo info) {
        return tblMarketParkInfoMapper.findTblMarketParkInfoByCondition(info);
    }

    @Override
    public Integer insertTblMarketParkInfo(TblMarketParkInfo info) {
        String time = CommonFunction.getLocalTime14();
        info.setStatus("1");
        info.setPublishTime(time);
        info.setParketRequestId(StringUtil.getUUID());
        info.setCreateTime(time);
        info.setMessageId(StringUtil.getUUID());
        info.setLastUpdateTime(time);
        info.setLastUpdateUser(info.getCreateUser());
       return tblMarketParkInfoMapper.insertTblMarketParkInfo(info);
    }

    @Override
    public Integer updateTblMarketParkInfo(TblMarketParkInfo info) {
        info.setLastUpdateTime(CommonFunction.getLocalTime14());
        info.setLastUpdateUser(info.getCreateUser());
           return tblMarketParkInfoMapper.updateTblMarketParkInfo(info);
    }
}
